package demo5;

import demo3.clothes;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.stereotype.Component;
import org.springframework.stereotype.Controller;
import org.springframework.stereotype.Repository;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;

@Component
//@Controller
//@Service
//@Repository
public class person
{
    @Autowired
//    @Resource(name="shirt")//可传类名 ，也可传Bean名称，首字母小写
    @Qualifier("winter") // 用于指定注入的Bean名称，解决同一类型多个Bean的注入冲突
//    private shirt s;
//    private sweater sw;
    clothes clo;

    public void play()
    {
//        shirt s=new shirt();
        clo.wear();
        System.out.println("playgogogo");
    }
}
